extends common

block layout
  body
    body.skin-blue.sidebar-mini
      .wrapper
        header.main-header
          a.logo(href='/')
            span.logo-mini
              b W
              | iki
            span.logo-lg
              b WIKI
              |  文档中心
          nav.navbar.navbar-static-top(role='navigation')
            a.sidebar-toggle(href='#', data-toggle='offcanvas', role='button')
              span.sr-only Toggle navigation
            .navbar-custom-menu
              ul.nav.navbar-nav
                if loginInfo != false
                  li.user-menu
                    a.jq-add(href='javascript:;')
                      i.fa.fa-plus-square-o
                      |   创建文档
                  li.dropdown.user.user-menu
                      a.dropdown-toggle(href='#', data-toggle='dropdown')
                        img.user-image(src='/theme/img/user2-160x160.jpg', alt='User Image')
                        span.hidden-xs #{loginInfo.userName}
                      ul.dropdown-menu
                        li.user-header
                          img.img-circle(src='/theme/img/user2-160x160.jpg', alt='User Image')
                          if loginInfo.role == 0
                            p #{loginInfo.userName} - 开发人员
                              small #{loginInfo.email}
                          if loginInfo.role == 1
                            p #{loginInfo.userName} - 产品经理
                              small #{loginInfo.email}
                          if loginInfo.role == 2
                            p #{loginInfo.userName} - 测试人员
                              small #{loginInfo.email}
                          if loginInfo.role == 3
                            p #{loginInfo.userName} - 项目管理
                              small #{loginInfo.email}
                          if loginInfo.role == 99
                            p #{loginInfo.userName} - 超级管理员
                              small #{loginInfo.email}
                        li.user-footer
                          .pull-left
                            a.btn.btn-default.btn-flat(href='javascript:;')
                              i.fa.fa-gears  设置
                          .pull-right
                            a.btn.btn-default.btn-flat(href='/users/logout')
                              i.fa.fa-sign-out  退出
                else
                  li.dropdown.user.user-menu
                    a.dropdown-toggle(href='/users/login')
                      img.user-image(src='/theme/img/user2-160x160.jpg', alt='User Image')
                      span.hidden-xs 登陆 / 注册
        aside.main-sidebar
          section.sidebar
            form.sidebar-form(action='/api/search', method='get')
              .input-group
                input.form-control(type='text', name='s', placeholder='Search...')
                span.input-group-btn
                  button#search-btn.btn.btn-flat(type='submit')
                    i.fa.fa-search
            ul.sidebar-menu
              li.header Markdown 文档
                each item in tree.subNodes
                  li.treeview
                    a(href='#',title='#{item.pathName}')
                      i.fa.fa-server
                      span #{item.pathName}
                      i.fa.fa-angle-left.pull-right
                    ul.treeview-menu
                      each item2 in item.subNodes
                        li
                          a(href='#',title='#{item2.pathName}')
                            i.fa.fa-circle-o
                            |  #{item2.pathName}
                            i.fa.fa-angle-left.pull-right
                          ul.treeview-menu
                            each item3 in item2.files
                              li
                                a(href='/book?md=#{item.pathName}/#{item2.pathName}/#{item3}',title='#{item.pathName}/#{item2.pathName}/#{item3}')
                                  i.fa.fa-book
                                  |  #{item3}
                      each item2 in item.files
                        li
                          a(href='/book?md=#{item.pathName}/#{item2}',title='#{item.pathName}/#{item2}')
                            i.fa.fa-book
                            |  #{item2}
        .content-wrapper
          block content
        footer.main-footer
          .pull-right.hidden-xs
            i.fa.fa-user-md
            b  By.
            a(href='http://github.com/chinakids',target='_blank') @Chinakids
            |  -  
            i.fa.fa-github
            b  Fork
            a(href='http://github.com/chinakids/node-wiki',target='_blank') This program.
            |  -  
            i.fa.fa-exclamation-circle
            b  Report
            a(href='http://github.com/chinakids/node-wiki/issues',target='_blank') Thie issues.
          strong Copyright &copy; 2014-2015
          |  All rights reserved.
